package cn.huijielong.modules.pub.dao;

import cn.huijielong.common.utils.Query;
import cn.huijielong.modules.pub.entity.MerchantEntity;
import cn.huijielong.modules.sys.dao.BaseDao;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 商户表
 * 
 * @author xys
 * @email xys@gmail.com
 * @date 2019-07-03 22:46:43
 */
@Mapper
public interface MerchantDao extends BaseDao<MerchantEntity> {
	Long queryMerchantId(@Param("userId")Long userId);
	List<Long> queryMerchants(@Param("userId")Long userId);
	List<Query> queryUserByMerId(Long merchantId);
	int saveMerchantUser(Query data);
	int updateMerchantUser(Query data);
	int deleteUser(Query data);
	Long querySelectedMerchantId(@Param("userId")Long userId);
	/**
	 * 查询商户还可以创建用户的数量
	 * @param merchantId
	 * @return
	 */
	Query getFreeUser(Long merchantId);
}
